﻿/*----------------------------------------------------------------
//  <copyright file="DisplayInfoAttribute.cs" company="MicroCloud@151504200868">
//      Copyright © 2020-2024 MicroCloud Corporation, All rights reserved.
//  </copyright>
//  <site>https://gitee.com/chenmm123/microclouds</site>
//  <last-editor>cmm</last-editor>
//  <last-date>2024-03-04 14:41</last-date>
//----------------------------------------------------------------*/

namespace MicroCloud.AspNetCore.Mvc
{
    #region "显示信息特性"
    /// <summary>
    /// 显示信息特性
    /// <para>继承 <see cref="DisplayNameAttribute"/> 属性</para>
    /// </summary>
    public sealed class DisplayInfoAttribute : DisplayNameAttribute
    {
        #region "属性"
        #region "获取 显示值"
        /// <summary>
        /// 获取 显示值
        /// </summary>
        public string Value { get; }
        #endregion
        #region "获取 显示名称"
        /// <summary>
        /// 获取 显示名称
        /// </summary>
        public string Name
        {
            get { return DisplayNameValue; }
        }
        #endregion

        #endregion

        #region "构造函数"
        #region "初始化一个显示信息特性的新实例"
        /// <summary>
        /// 初始化一个显示信息特性 <see cref="DisplayInfoAttribute" /> 的新实例
        /// </summary>
        /// <param name="name">显示名称</param>
        /// <param name="value">显示值</param>
        public DisplayInfoAttribute(string name, string value)
            : base(name)
        {
            Check.NotNullOrEmpty(name, nameof(name));
            Check.NotNullOrEmpty(value, nameof(value));

            Value = value;
        }
        #endregion

        #endregion

    }
    #endregion

}
